<template>
  <el-dialog
    class="troila-dialog addPerson"
    title="添加成员"
    :visible.sync="dialogFormVisible"
    :modal-append-to-body="true"
    :append-to-body="true"
    width="600px"
  >
   
    <div slot="footer" class="dialog-footer">
      <el-button type="primary" :loading="ajaxIng" @click="submit"
        >确 定</el-button
      >
      <el-button @click="dialogFormVisible = false">{{
        ajaxIng ? '关 闭' : '取 消'
      }}</el-button>
    </div>
  </el-dialog>
</template>
<script>
export default {
  name: 'addPerson',
  props: {
    value: {
      // row
      type: [Boolean, Object],
      default: false,
    },
  },
  data() {
    return {
      dialogFormVisible: this.value ? true : false, //弹窗显示
      ajaxIng: false,
      
    }
  },
  watch: {
    value(v) {
      let show = v ? true : false
      this.dialogFormVisible !== show ? (this.dialogFormVisible = show) : null
    //   for (let k in this.form) {
    //     typeof this.form[k] == 'string' || typeof this.form[k] == 'number'
    //       ? (this.form[k] = '')
    //       : (this.form[k] = [])
    //   }
    //   this.form.roleId = v.roles
    //     ? v.roles.map((v) => {
    //         return v.id
    //       })
    //     : null
    //   this.$nextTick(() => {
    //     this.$refs.form ? this.$refs.form.clearValidate() : null
    //   })
      show ? (this.ajaxIng = false) : null
    },
    dialogFormVisible(v) {
      v ? null : this.$emit('input', v)
    },
  },
  created() {},
  methods: {
    submit(){

    }
  },
}
</script>
<style>
/* .addProject .el-dialog__body {
  height: 298px;
  box-sizing: border-box;
} */
</style>